﻿<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
		<!-- Google Chrome Frame也可以让IE用上Chrome的引擎: -->
		<meta name="renderer" content="webkit">
		<!--国产浏览器高速模式-->
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="author" content="穷在闹市" />
		<!-- 作者 -->
		<meta name="revised" content="穷在闹市.v3, 2019/05/01" />
		<!-- 定义页面的最新版本 -->
		<meta name="description" content="网站简介" />
		<!-- 网站简介 -->
		<meta name="keywords" content="搜索关键字，以半角英文逗号隔开" />
		<title>主页</title>

		<!-- 公共样式 开始 -->
		<link rel="stylesheet" type="text/css" href="../css/base.css">
		<link rel="stylesheet" type="text/css" href="../css/iconfont.css">
		<script type="text/javascript" src="../framework/jquery-1.11.3.min.js"></script>
		<link rel="stylesheet" type="text/css" href="../layui/css/layui.css">
		<script type="text/javascript" src="../layui/layui.js"></script>
		<!-- 滚动条插件 -->
		<link rel="stylesheet" type="text/css" href="../css/jquery.mCustomScrollbar.css">
		<script src="../framework/jquery-ui-1.10.4.min.js"></script>
		<script src="../framework/jquery.mousewheel.min.js"></script>
		<script src="../framework/jquery.mCustomScrollbar.min.js"></script>
		<script src="../framework/cframe.js"></script><!-- 仅供所有子页面使用 -->
		<!-- 公共样式 结束 -->

	</head>

	<body>
		<div class="cBody">
		<form id="addForm" class="layui-form" action="">









			<table>

				<tr>
					<td>后台管理员ID</td>
					<td>
						<span id="adminId_txt"></span><input type="hidden" id="adminId" name="adminId" readonly/>
					</td>
				</tr>
				<tr>
					<td>登录名</td>
					<td>
						<input type="text" id="loginName" name="loginName"/>
					</td>
				</tr>
				<tr>
					<td>密码</td>
					<td>
						<input type="text" id="password" name="password"/>
					</td>
				</tr>
				<tr>
					<td>用户真实姓名</td>
					<td>
						<input type="text" id="adminName" name="adminName" readonly/>
					</td>
				</tr>
				<tr>
					<td>证件号码</td>
					<td>
						<input type="text" id="identityCardNo" name="identityCardNo" readonly/>
					</td>
				</tr>
				<tr>
					<td>手机号</td>
					<td>
						<input type="text" id="mobilePhone" name="mobilePhone"/>
					</td>
				</tr>
				<tr>
					<td>邮箱</td>
					<td>
						<input type="text" id="adminEmail" name="adminEmail"/>
					</td>
				</tr>
				<tr>
					<td>用户类型</td>
					<td>
						<input type="text" id="type" name="type" readonly/>
					</td>
				</tr>
				<tr>
					<td>负责区域</td>
					<td>
						<input type="text" id="responsible" name="responsible" readonly/>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<input type="button" id="tijiao" value="提交"/>
						<input type="reset" value="重置"/>
					</td>
				</tr>
			</table>



		</form>
		</div>



			<script>
				layui.use('form', function() {
					var form = layui.form;
					//监听提交
					form.on('submit(submitBut)', function(data) {
						layer.msg(JSON.stringify(data.field));
						return false;
					});
				});


                var param = location.href.substring(location.href.indexOf('?')+1);
                $.getJSON("/admin/findById.json",param,function(detail){
                    $("#adminId_txt").text(detail.adminId);
                    $("#adminId").val(detail.adminId);
                    $("#loginName").val(detail.loginName);
                    $("#password").val(detail.password);
                    $("#adminName").val(detail.adminName);
                    $("#identityCardNo").val(detail.identityCardNo);
                    $("#mobilePhone").val(detail.mobilePhone);
                    $("#adminEmail").val(detail.adminEmail);
                    $("#birthday").val(detail.birthday);
                    $("#type").val(detail.type);
                    $("#responsible").val(detail.responsible);

                });

                $.post("/admin/update.json",$("form").serialize(),function(result){
                    if(result.flag==true){
                        alert(result.msg);
                    }else{
                        alert(result.msg);
                    }
                })



			</script>

	</body>

</html>
